    style = {
        "toast":{
            "pos":"fixed",
            "t":"50%",
            "l":"50%",
            "w":"200px",
            "tc":"center",
            "h":"120px",
        },
        "box":{
            "w":"200px",
            "h":"120px",
            "l":"-100px",
            "t":"-60px",
            "bg":"rgba(0,0,0,0.6)",
            "bdr":"6px",
            "bd":"1px solid #999"
        },
        "text":{
            "tc":'center',
            "c":"#fff"
        },
        "dp":{
            "dn":'none',
            "db":'block'
        },
        "img":{
            "w":"50px",
            "srcR":"/static/img/login/right.png",
            "srcF":"/static/img/login/false.png",
            "pd":"18px 0"
        }
    }


    toast = function(num){
        // toast
        var toast = document.createElement("div");
        toast.setAttribute("id","toast");
        toast.style.position = style.toast.pos;
        toast.style.top = style.toast.t;
        toast.style.left = style.toast.l;
        toast.style.width = style.toast.w;
        toast.style.height = style.toast.h;
        toast.style.textAlign = style.toast.tc;

        toast.style.display = style.dp.dn;

        // box
        var box = document.createElement("div");
        box.setAttribute("id","box");
        box.style.marginTop = style.box.t;
        box.style.marginLeft = style.box.l;
        box.style.width = style.box.w;
        box.style.height = style.box.h;
        box.style.background = style.box.bg;
        box.style.borderRadius = style.box.bdr;
        box.style.border = style.box.bd;

        // text
        var text = document.createElement("p");
        text.setAttribute("id","text");
        text.style.textAlign = style.text.tc;
        text.style.color = style.text.c;


        //image 
        var img = new Image();
        img.setAttribute("id","image");
        img.style.width = style.img.w;
        img.style.padding = style.img.pd;

        //  页面加载时候实现加载图片，防止在调用时候无法及时显示  出现加载状态
        var imgf = new Image();
        imgf.src = style.img.srcF;
        imgf.setAttribute("style","display:none;");

        var imgr = new Image();
        imgr.src = style.img.srcR;
        imgr.setAttribute("style","display:none;");
        document.getElementsByTagName("body")[0].appendChild(imgr);
        document.getElementsByTagName("body")[0].appendChild(imgf);




        // 判断： 0  的时候 账号或密码错误
        // 判断： 1  的时候 验证码错误
        // 判断： 2  的时候 注册成功  
        // 判断： 3  的时候 密码修改成功  
        
        // var text = document.getElementById("text");
        // var img = document.getElementById("image");
        if (num == 0) {
            text.innerHTML = "账号或密码错误";
            img.src = style.img.srcF;
        } else if(num == 1) {
            text.innerHTML = "账号或验证码错误";
            img.src = style.img.srcF;
        } else if(num == 2) {
            text.innerHTML = "注册成功";
            img.src = style.img.srcR;
        } else if(num == 3) {
            text.innerHTML = "密码修改成功";
            img.src = style.img.srcR;
        }

        box.appendChild(img);
        box.appendChild(text);
        toast.appendChild(box);

        document.getElementsByTagName("body")[0].appendChild(toast);



        toast.style.display = style.dp.db;
        setTimeout(function(){
            toast.style.display = style.dp.dn;
        },2000);
    }
